﻿<phone:PhoneApplicationPage 
    x:Class="RulesOfAcquisition.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI">

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="DarkGoldenrod">
		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="80"/>
		</Grid.RowDefinitions>

		<!--Panorama control-->
		<controls:Panorama Title="rules of acquisition" SelectionChanged="Panorama_SelectionChanged">

			<controls:PanoramaItem Header="random" >
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="*"/>
						<RowDefinition Height="200"/>
					</Grid.RowDefinitions>

					<StackPanel Grid.Row="0" Orientation="Vertical">
						<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
							<TextBlock Text="Rule" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
							<TextBlock Text="{Binding RandomRule.Number}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
						</StackPanel>
						<StackPanel Height="20"></StackPanel>
						<TextBlock HorizontalAlignment="Left" Text="{Binding RandomRule.Description}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
					</StackPanel>
					<StackPanel Grid.Row="1" VerticalAlignment="Top" >
						<Button Content="Shake" Tap="Button_Tap" />
					</StackPanel>
				</Grid>
			</controls:PanoramaItem>

			<!--Panorama item one-->
			<controls:PanoramaItem Header="the rules">
				<!--Double line list with text wrapping-->
				<ListBox Name="listBox1" ItemsSource="{Binding Items}" HorizontalContentAlignment="Stretch">
					<ListBox.ItemContainerStyle>
						<Style TargetType="ListBoxItem">
							<Setter Property="Template">
								<Setter.Value>
									<ControlTemplate>
										<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
									</ControlTemplate>
								</Setter.Value>
							</Setter>
						</Style>
					</ListBox.ItemContainerStyle>
					<ListBox.ItemTemplate>
						<DataTemplate>
							<StackPanel Orientation="Vertical">
								<Border Background="{Binding BackgroundColor}" HorizontalAlignment="Stretch">
									<TextBlock HorizontalAlignment="Stretch" Text="{Binding FullDescription}" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"/>
								</Border>
							</StackPanel>
						</DataTemplate>
					</ListBox.ItemTemplate>
				</ListBox>
			</controls:PanoramaItem>

			<controls:PanoramaItem Header="about">
				<StackPanel Orientation="Vertical">
					<TextBlock HorizontalAlignment="Left" Height="80" VerticalAlignment="Top" TextWrapping="Wrap" 
							   Style="{StaticResource PhoneTextLargeStyle}"
							   Text="Developed by Matt Lott."  />
					<HyperlinkButton Content="http://www.mattlott.com/RulesOfAcquisition.htm" HorizontalAlignment="Center" 
									 NavigateUri="http://www.mattlott.com/RulesOfAcquisition.htm" TargetName="_blank"
									 VerticalAlignment="Bottom" FontSize="18"/>
				</StackPanel>
			</controls:PanoramaItem>
		</controls:Panorama>

		<StackPanel Grid.Row="1" VerticalAlignment="Bottom">
			<my:AdControl AdUnitId="10036062" ApplicationId="21c52bcd-0d22-4059-8c9f-e59dc0de0361" Height="80" Name="adControl1" Width="480" />
		</StackPanel>
	</Grid>
</phone:PhoneApplicationPage>